import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import {rules} from '/@/utils/helper/validator';
import {render} from '/@/utils/common/renderUtils';
import {getWeekMonthQuarterYear} from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
	{
		title: '中文描述',
		align: 'center',
		dataIndex: 'cnName',
	},
	{
		title: '英文描述',
		align: 'center',
		dataIndex: 'enName',
	},
	{
		title: '详细内容',
		align: 'center',
		dataIndex: 'warnDesc',
	},
	{
		title: '告警显示内容',
		align: 'center',
		dataIndex: 'warnShowInfo',
	},
	{
		title: '数据值？阈值',
		align: 'center',
		dataIndex: 'val',
	},
	{
		title: '预警等级？？（1高2中3低）',
		align: 'center',
		dataIndex: 'level',
	},
	{
		title: '告警级别',
		align: 'center',
		dataIndex: 'warnLevel',
	},
	{
		title: '算法释义？？',
		align: 'center',
		dataIndex: '',
	},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
		label: '车辆的VIN',
		field: 'vin',
		component: 'JInput',
		//colProps: {span: 6},
	},
	{
		label: '告警等级',
		field: 'level',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: 'riskLevel',
		},
		//colProps: {span: 6},
	},
];
//表单数据
export const formSchema: FormSchema[] = [
	{
		label: '中文描述',
		field: 'cnName',
		component: 'Input',
	},
	{
		label: '英文描述',
		field: 'enName',
		component: 'Input',
	},
	{
		label: '详细内容',
		field: 'warnDesc',
		component: 'Input',
	},
	{
		label: '告警显示内容',
		field: 'warnShowInfo',
		component: 'Input',
	},
	{
		label: '数据值',
		field: 'val',
		component: 'Input',
	},
	{
		label: '等级（1高2中3低）',
		field: 'level',
		component: 'InputNumber',
	},
	{
		label: '告警级别',
		field: 'warnLevel',
		component: 'InputNumber',
	},
	// TODO 主键隐藏字段，目前写死为ID
	{
		label: '',
		field: 'id',
		component: 'Input',
		show: false,
	},
];

// 高级查询数据
export const superQuerySchema = {
	cnName: {title: '中文描述', order: 0, view: 'text', type: 'string'},
	enName: {title: '英文描述', order: 1, view: 'text', type: 'string'},
	warnDesc: {title: '详细内容', order: 2, view: 'text', type: 'string'},
	warnShowInfo: {title: '告警显示内容', order: 3, view: 'text', type: 'string'},
	val: {title: '数据值', order: 4, view: 'text', type: 'string'},
	level: {title: '等级（1高2中3低）', order: 5, view: 'number', type: 'number'},
	warnLevel: {title: '告警级别', order: 6, view: 'number', type: 'number'},
};

/**
 * 流程表单调用这个方法获取formSchema
 * @param param
 */
export function getBpmFormSchema(_formData): FormSchema[] {
	// 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
	return formSchema;
}
